//意见反馈
import request from '../utils/request'

//创建新的
export function getList(params) {
    return request.ajax({
        url: `/order/list`,
        method: 'get',
        params
    })
}
export function getOrder(id){
    return request.ajax({
        url:`/order/list/${id}`,
        method:'post',
        loading:true
    })
}
export function createOrder(params){
    return request.ajax({
        url:`/order/create`,
        method:'post',
        loading:true,
        params
    })
}
export function delayPay(params){
    return request.ajax({
        url:`/order/delayPay`,
        method:'post',
        loading:true,
        params
    })
}
export function refundApply(params){
    return request.ajax({
        url:`/order/refundApply`,
        method:'post',
        loading:true,
        params
    })
}

export function cancelOrder(params) {
  return request.ajax({
    url:`/order/delOrder`,
    method:'post',
    loading:true,
    params
  })
}

//获取积分
export function getInterial(price) {
  return request.ajax({
    url:`/order/getIntegral`,
    method:'post',
    params: {
      totalPrice: price
    }
  })
}

//获取当前积分/client/order/getIntegral
// export function getIntegralForOrder() {
//   return request.ajax({
//     url:`/order/getIntegral`,
//     method:'post'
//   })
// }